package Employee;

public class Test {
    public static void main(String[] args) {
        Employee employee = new Employee("张三","男",24);
        employee.showInfo();
        Employee employee1 = new Employee("总管",10000);
        employee1.showInfo();
        Employee employee2 = new Employee("张三","男",24,"总管",10000);
        employee2.showInfo();
    }
}

//创建一个Employee类
//属性：名字，性别，年龄，职位，薪水
//3个构造方法
//1.初始化名字，性别，年龄，职位，薪水
//2.初始化名字，性别，年龄
//3.初始化职位，薪水
class Employee{
    String name,sex,position;
    int salary,age;
    public Employee(String name,String sex,int age){
        this.name = name;
        this.sex = sex;
        this.age = age;
    }
    public Employee(String position,int salary){
        this.position = position;
        this.salary = salary;
    }

    public Employee(String name,String sex,int age,String position,int salary){
       this(name, sex, age);
       this.position = position;
       this.salary = salary;
    }

    public void showInfo(){
        System.out.println(this.name+" "+this.sex+" "+this.age+" "+this.position+" "+this.salary);
    }

}
